/*
 ID: brodyzt1
 PROG: friday
 LANG:C++
*/

//1,3,5,6,7,10,12

#include <iostream>
#include <string>
#include <fstream>

using namespace std;

int daysPerMonth (int monthNum, int year)
{
    if (monthNum == 4 || monthNum == 6 || monthNum == 9 || monthNum == 11) {
        return 30;
    }
    else if(monthNum == 1 || monthNum == 3 || monthNum == 5 || monthNum == 7 || monthNum == 8 || monthNum == 10 || monthNum == 12)
    {
        return 31;
    }
    else {
        if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
        {
            return 29;
        }
        else {
            return 28;
        }
    }
}

int calcOccurOfDay(int dayOfWeek, int years)
{
    int currentDayOfWeek = 2;
    int occurences = 0;
    for (int i = 0; i < years; i++) {
        for (int j = 1; j <= 12; j++) {
            for (int k = 1; k <= daysPerMonth(j, (1900 + i)); k++) {
                if (currentDayOfWeek == dayOfWeek && k == 13) {
                    occurences ++;
                    //cout << "(" << i << "," << j << "," << currentDayOfWeek << ")\n";
                }
                    currentDayOfWeek ++;
                    if (currentDayOfWeek == 7) {
                        currentDayOfWeek = 0;
                }
        
            }
            //cout << daysPerMonth(j, 1990 + i) << "\n";
        }
    }
    return occurences;
}

int main(int argc, const char * argv[])
{
    ifstream input;
    ofstream output;
    input.open("friday.in");
    output.open("friday.out");
    int N;
    input >> N;
   /* int days[7];
    for (int i = 0; i < 7; i++) {
        days[i] = 0;
    }*/
    
    for (int i = 0; i < 7; i++) {
        if (i != 6) {
            output << calcOccurOfDay(i, N) << " ";
        }
        else {
            output << calcOccurOfDay(i, N) << "\n";
        }
    }
    input.close();
    output.close();
    return 0;
}

